package com.example.testproject.activity

import android.os.Bundle
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import com.example.testproject.R
import com.example.testproject.databinding.LandDataBinDing
import com.example.testproject.view_model.LandViewModel

/**
 *
 * @ClassName: LnadActivity
 * @Author: android 超级兵
 * @CreateDate: 11/2/21$ 9:59 AM$
 * TODO 横竖屏切换测试
 */
class LandActivity : AppCompatActivity() {

    private val viewModel by viewModels<LandViewModel>()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        val dataBinDing =
            DataBindingUtil.setContentView<LandDataBinDing>(this, R.layout.activity_land)
        dataBinDing.viewModel = viewModel

        viewModel.tempLiveData.observe(this) {
            dataBinDing.tv.text = "$it"
        }

    }
}